Skip to content

Instantly share code, notes, and snippets.

@rxaviers
rxaviers / gist:7360908
Last active May 21, 2024 13:01
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: πŸ˜„ :smile: πŸ˜† :laughing:
😊 :blush: πŸ˜ƒ :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
πŸ˜† :satisfied: 😁 :grin: πŸ˜‰ :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: πŸ˜€ :grinning:
πŸ˜— :kissing: πŸ˜™ :kissing_smiling_eyes: πŸ˜› :stuck_out_tongue:
@stenito
stenito / publicip.php
Last active May 21, 2024 13:01
Get public IP address (or wan IP address) with php function
<?php
function getPublicIP() {
// create & initialize a curl session
$curl = curl_init();
// set our url with curl_setopt()
curl_setopt($curl, CURLOPT_URL, "http://httpbin.org/ip");
// return the transfer as a string, also with setopt()
@onhate
onhate / pre-signup.ts
Last active May 21, 2024 13:00
Merge AWS Cognito External Provider User with Cognito User on Pre SignUp
import { PreSignUpTriggerEvent, PreSignUpTriggerHandler } from 'aws-lambda';
import { CognitoIdentityServiceProvider } from 'aws-sdk';
const cognito = new CognitoIdentityServiceProvider();
const knownProviderNames = {
google: 'Google',
facebook: 'Facebook'
};
@3xocyte
3xocyte / dementor.py
Last active May 21, 2024 12:59
rough PoC to connect to spoolss to elicit machine account authentication
#!/usr/bin/env python
# abuse cases and better implementation from the original discoverer: https://github.com/leechristensen/SpoolSample
# some code from https://www.exploit-db.com/exploits/2879/
import os
import sys
import argparse
import binascii
import ConfigParser
@donvito
donvito / main.go
Last active May 21, 2024 12:58
AES-256 encrypt/decrypt in Go
package main
import (
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"encoding/hex"
"fmt"
"io"
)
@dschep
dschep / py-comp-to-js.md
Last active May 21, 2024 12:58
Python Comprehensions to JS

Python list & dict comprehensions translated to JavasScript

Comprehensions are a really useful feature of Python that aren't available in JavaScript (or many languages). These concepts of course can be tranlsated into using map instead. But especially the dictionaries are a bit trickier.

Lists / Arrays

>>> foobar = range(5)
>>> [x + 1 for x in foobar]
[1, 2, 3, 4, 5]
@voluntas
voluntas / shiguredo_recruit.rst
Last active May 21, 2024 12:57
ζ™‚ι›¨ε ‚γ‚’ζ”―γˆγ‚‹ζŽ‘η”¨

ζ™‚ι›¨ε ‚γ‚’ζ”―γˆγ‚‹ζŽ‘η”¨

ζ›΄ζ–°

2024-05-18

δ½œθ€…

@voluntas

バージョン

2024.6

url

https://voluntas.github.io/

概要

@lambdaxyzt
lambdaxyzt / image.jsx
Last active May 21, 2024 12:55
Remix Image Component ( use cache 'cacashe library' , stream base , sharp library )
// resource route component
import React from "react";
import { PassThrough } from "node:stream"
import fs from "node:fs"
import {createReadableStreamFromReadable} from "@remix-run/node"
import { defaultQuality,widths,mainImageReadStream,generatedImageReadstream, isThereImage,BadImageResponse } from "../../util/image.server"
export const loader = async ({ request }) => {
const url = new URL(request.url);
const src = url.searchParams.get("src");
@marko-jankovic
marko-jankovic / CSS and HTML interview questions.md
Last active May 21, 2024 12:58
CSS and HTML interview questions

CSS


What is CSS?

  • CSS stands for Cascading Style Sheet.
  • Styles define how to display HTML elements
  • Styles were added to HTML 4.0 to solve a problem
  • External Style Sheets can save a lot of work
  • External Style Sheets are stored in CSS files
@wojteklu
wojteklu / clean_code.md
Last active May 21, 2024 12:53
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules